package com.gouqi.lpl.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gouqi.lpl.domain.Team;
import com.gouqi.lpl.service.TeamService;
import com.gouqi.lpl.mapper.TeamMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class TeamServiceImpl extends ServiceImpl<TeamMapper, Team>
    implements TeamService{

    @Resource
    private TeamMapper teamMapper;

    @Override
    public List<Team> getTeam() {
        LambdaQueryWrapper<Team> queryWrapper = new LambdaQueryWrapper<>();
        List<Team> teamList = teamMapper.selectList(queryWrapper);
        return teamList;
    }

    @Override
    public List<Team> getTeamByOrder() {
        LambdaQueryWrapper<Team> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.orderBy(true, false, Team::getSAveragingWin);
        List<Team> teamList = teamMapper.selectList(queryWrapper);
        return teamList;
    }
}




